package com.example.gdeserver.contr;

import com.example.gdeserver.mapper.DataMapper;
import com.example.gdeserver.mapper.UserMapper;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@RestController
public class User {
    @Autowired
    UserMapper userMapper;

    //用户列表
    @GetMapping("/user")
    public List<Map<String, Object>> userList() {
        return userMapper.userList();
    }

    //用户列表
    @GetMapping("/user/{userid}")
    public ArrayList<List<Map<String, Object>>> userInfo(@PathVariable("userid") String userid) {
        ArrayList<List<Map<String, Object>>> maps = new ArrayList<>();
        maps.add(userMapper.userSoftware(userid));
        maps.add(userMapper.userWebsits(userid));
        return maps;
    }


}
